import React, { Component } from 'react'
import MainBanner from './MainBanner'

export default class Main extends Component {
  constructor() {
    super()
    this.state = {
      count: 100
    }
  }
  changeAddHandlerClick(count){
    this.setState({
      count:this.state.count + count
    })
  }
  render() {
    const { count } = this.state
    return (
      <div>
        <h1>我是总数{count}</h1>
        <MainBanner addClick={(count)=>{this.changeAddHandlerClick(count)}} />
      </div>
    )
  }
}
